Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@bedrock-layout/spacing-constants
Advanced tools
@bedrock-layout/spacing-constants
Full docs at: bedrock-layout.dev
Spacing constants are the standard by which all spacing and layout decisions are made in the Bedrock Layout Primitives. Generally speaking, you won't typically need to pull these in to your App Directly since the Layout Primitives already implement them, but these do exist incase you ever need the raw values.
The spacing is built simply on 1rem
as the starting mid point and then doubling the value at each step above and halfing the value each step below. This comes down to the following spacings: 0
, 0.125rem
, 0.25rem
, 0.5rem
, 1rem
, 2rem
, 4rem
. Each one of these spacing points are then named based on t-shirt size or none
, xs
, sm
, md
, lg
, xl
, and xxl
respectively.
For the breakpoints, we are adopting the foundation breakpoint values. All values are given in rems
. There are two types of constants, single value and range values. medium
, large
, xlarge
, and xxlarge
are intended communicate that size or smaller. The constants are smallOnly
, mediumOnly
, largeOnly
, and xlargeOnly
and will be an array with the first value being the lowerbound and the second value being the upperbound;.
import { spacing, breakpoints } from '@bedrock-layout/spacing-constants';
spacing.sm; //0.25rem
breakpoints.large; //64rem
All of the Bedrock Layout Primitives are built using styled-components
. In order to override the values of any or all of the constants, you can use the ThemeProvider
to change the values. The ThemeProvider
can be rendered at any level of the tree and will override the values at that point. Check out the docs for styled-components
for more details on how it works
import { ThemeProvider } from 'styled-components';
const newSpacings = {
sm:'45px',
xxlg:'100ch'
}
<ThemeProvider theme={{spacing:newSpacings}}>
<Stack gutter="sm">
{...}
</Stack>
</ThemeProvider>;
FAQs
bedrock-layout spacing constants
We found that @bedrock-layout/spacing-constants demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.